package com.example.eventexample.eventbus

import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import com.example.eventexample.R
import com.zee.extendobject.eventBusPost
import com.zee.extendobject.eventBusPostTagNoParam
import com.zee.extendobject.eventBusRegisterBindCurActivity
import com.zee.extendobject.showToastShort
import com.zee.log.ZLog
import kotlinx.android.synthetic.main.activity_main.*
import org.greenrobot.eventbus.SubscribeSimple

class EventBusMainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        eventBusRegisterBindCurActivity(this)
        tv_a.setOnClickListener {
            eventBusPostTagNoParam("tag1", "tag2", "tag3")
        }
    }

    @SubscribeSimple("tag1")
    fun onTest() {
        ZLog.i("第一个单个")
    }

    @SubscribeSimple("tag2")
    fun onTest2() {
        ZLog.i("第2个单个")
    }

    @SubscribeSimple("tag3")
    fun onTest3() {
        ZLog.i("第3个单个")
    }
}
